<?php
	include '../ini.php';
	include '../../libraries/xl_lien_he.php';
	$dt_xl_lien_he=new xl_lien_he;
	include '../../libraries/my_pager.php';
	$dt_phan_trang=new my_pager;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper">
<!-- Wrapper for the radial gradient background -->

<?php include '../widgets/sidebar.php'?>
<div id="main-content"> <!-- Main Content Section with everything --> 
  <!--noscript--> 
  <!-- Page Head --> 
  <!-- End .shortcut-buttons-set -->
  
  <div class="clear"></div>
  <!-- End .clear -->
  
  <div class="content-box"><!-- Start Content Box -->
    
    <div class="content-box-header">
      <h3>Danh sách liên hệ</h3>
      <div class="clear"></div>
    </div>
    <!-- End .content-box-header -->
    
    <div class="content-box-content">
      <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
        <?php thong_bao()?>
        <form name="f_lien_he" method="post" action="xoa_nhieu.php">
          <table>
            <thead>
              <tr>
                <th><input title="Chọn" class="check-all" type="checkbox" /></th>
                <th>Mã</th>
                <th>Họ và Tên</th>
                <th>E-mail</th>
                <th>Tiêu đề</th>
                <th>Ngày</th>
                <th>Trạng thái</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="7"><div class="bulk-actions align-left"><a onclick="if(confirm('Bạn có muốn xóa liên hệ đã chọn không?')==true) document.f_lien_he.submit()" class="button">Xóa</a> </div>
                  <div class="pagination">
                    <?php
                        $tong_so_lien_he=$dt_xl_lien_he->so_luong();
                        $tong_so_trang=$dt_phan_trang->tong_so_trang($tong_so_lien_he,ADMIN_LIMIT);
						if($tong_so_lien_he > ADMIN_LIMIT)
                        	echo $dt_phan_trang->xuat_phan_trang_admin($_GET['page'],$tong_so_trang);
                    ?>
                  </div>
                  <div class="clear"></div></td>
              </tr>
            </tfoot>
            <tbody>
              <?php
				$vi_tri=$dt_phan_trang->vi_tri(ADMIN_LIMIT);
				$ds_lien_he=$dt_xl_lien_he->danh_sach($vi_tri,ADMIN_LIMIT);
				foreach($ds_lien_he as $lien_he)
				{
			  ?>
              <tr>
                <td width="70px;"><input title="Chọn" type="checkbox" name="item[]" value="<?php echo $lien_he['ma']?>" />
                  
                  <!-- Icons --> 
                  <a onclick="return confirm('Bạn có muốn xóa liên hệ này không?');" href="xoa_sm.php?ma=<?php echo $lien_he['ma']?>" title="Xóa"><img src="../skins/sa/resources/images/icons/cross.png" alt="Delete" /></a></td>
                <td><?php echo $lien_he['ma']?></td>
                <td><a href="chi_tiet.php?ma=<?php echo $lien_he['ma']?>" title="Thông tin chi tiết"><?php echo $lien_he['ho_ten']?></a></td>
                <td><?php echo $lien_he['email']?></td>
                <td><?php echo $lien_he['tieu_de']?></td>
                <td><?php echo $lien_he['ngay_tao']?></td>
                <td><?php if($lien_he['trang_thai']==1) echo 'Đã trả lời'; else echo '<a href="tra_loi.php?ma='.$lien_he['ma'].'" title="Trả lời">Chưa trả lời</a>';?></td>
              </tr>
              <?php }?>
            </tbody>
          </table>
        </form>
      </div>
      <!-- End #tab1 --> 
      
    </div>
    <!-- End .content-box-content --> 
    
  </div>
  <!-- End .content-box -->
  
  <div class="clear"></div>
  <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> 
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
